package name.ekr.assetguide.test.builders;

import name.ekr.assetguide.data.PriceIterator;
import name.ekr.assetguide.domain.Portfolio;
import name.ekr.assetguide.domain.RebalancedPortfolio;
import name.ekr.assetguide.domain.StaticPortfolio;
import name.ekr.assetguide.data.DataLogger;

public class PortfolioBuilder {

	private double usdShare;
	private double goldShare;
	private double silverShare;
	private double sharesShare;
	private double bondsShare;
	private double rurShare;
	private DataLogger logger;
	private PriceIterator iterator;

	public PortfolioBuilder withUsdShare(double usdShare) {
		this.usdShare = usdShare;
		return this;
	}
	
	public PortfolioBuilder withGoldShare(double goldShare) {
		this.goldShare = goldShare;
		return this;
	}
	
	public PortfolioBuilder withSilverShare(double silverShare) {
		this.silverShare = silverShare;
		return this;
	}
	
	public PortfolioBuilder withSharesShare(double sharesShare) {
		this.sharesShare = sharesShare;
		return this;
	}
	
	public PortfolioBuilder withBondsShare(double bondsShare) {
		this.bondsShare = bondsShare;
		return this;
	}
	
	public PortfolioBuilder withRurShare(double rurShare) {
		this.rurShare = rurShare;
		return this;
	}
	
	public PortfolioBuilder withLogger(DataLogger logger) {
		this.logger = logger;
		return this;
	}
	
	public PortfolioBuilder withPriceIterator(PriceIterator iterator) {
		this.iterator = iterator;
		return this;
	}
	
	public Portfolio buildStaticPortfolio() {
        return new StaticPortfolio (
            iterator, logger,usdShare,
            goldShare, silverShare, sharesShare,
            bondsShare, rurShare
        );
	}

    public Portfolio buildRebalancedPortfolio() {
        return new RebalancedPortfolio (
                iterator, logger,usdShare,
                goldShare, silverShare, sharesShare,
                bondsShare, rurShare
        );
    }
}